<%@ page language="java" pageEncoding="UTF-8"%>
<%@include file="/page/util/include.jsp" %>
<link rel="stylesheet" type="text/css" href="../../ui/css/containers.css" />
<link rel="stylesheet" type="text/css" href="../../ui/css/base.css" />
<script type="text/javascript" src="../../ui/js/jQuery-1.3.2.js"></script>
<script type="text/javascript">
function discountFun(){
	if($("#isDiscountId").val()==0){
		$("#discountLableId").hide();
		$("#discountPriceId").hide();
		$("#discountUnitId").hide();
	}
	else if($("#isDiscountId").val()==1){
		$("#discountLableId").show();
		$("#discountPriceId").show();
		$("#discountUnitId").show();
	}
}
function extensionFun(){
	if($("#isExtensionId").val()==1){
		$("#extensionTrId").show();
	}
	else if($("#isExtensionId").val()==0){
		$("#extensionTrId").hide();
	}
}
function submitFun(){
	var message = "";
	if($("#productNameId").val()==""){
		message += "请输入产品名称?\n";	   
	}
	if($("#sellPriceId").val()==""){
	 	message += "请输入原价?\n";	 
	}
	if($("#isDiscountId").val()==1){
	    if($("#discountPriceId").val()==""){
			message += "请输入现价?\n";	 
	    }
	}
	if($("#productBriefId").val()==""){
		message += "请输入描述?\n";
	}
	// 返回
	if(message==""){
	    $("#submitFormId").submit();
	}
	else{
		alert(message);
	}
}

</script>

  <div class="woRegion" style="width:993px; _margin-top:-12px;">
  <form id="submitFormId" action="${pageContext.request.contextPath}/page/shop/addProductInfo" method="post">
   <div class="woMenu_top">
      <div class="woMenu_topLeft"></div>
      <div class="woMenu_topMiddle" style="width:985px;">
        <div class="woMenu_topMiddle_Title">产品上传</div>
        <div class="woMenu_operation"><a href="orderForm.html">返回首页</a></div> 
      </div>
      <div class="woMenu_topRight"></div>
    </div>
    <div class="woMenu_middle2" style="width:989px;">
      <div class="uploadPic">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
           <td class="uploadPic_list" onmousemove="this.className='uploadPic_list2'" onmouseout="this.className='uploadPic_list'">
           <img src="../../ui/images/uploadPic.gif" /></td>
           <td>&nbsp;</td>
           <td class="uploadPic_list" onmousemove="this.className='uploadPic_list2'" onmouseout="this.className='uploadPic_list'">
           <img src="../../ui/images/uploadPic.gif" /></td>
           <td>&nbsp;</td>
           <td class="uploadPic_list" onmousemove="this.className='uploadPic_list2'" onmouseout="this.className='uploadPic_list'">
           <img src="../../ui/images/uploadPic.gif" /></td>
          </tr>
        </table>
      </div>
      <div class="uploadInfo">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr height="40">
            <td width="16%" align="right">产品名称：</td>
            <td width="59%"><input id="productNameId" name="productName" class="extension_input"  style="width:500px;"/></td>
            <td width="25%">限10个字符以内</td>
          </tr>
          <!-- 
          <tr height="40">
            <td  align="right">选择类别：</td>
            <td><select class="extension_select" style="width:300px;">
            		<option>我要吃</option><option>
                </select></td>
            <td>&nbsp;</td>
          </tr>
          -->
        </table>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr height="40">
            <td width="16%" align="right">支付方式：</td>
            <td width="3%" align="center"><input type="checkbox" /></td>
            <td width="8%">在线支付</td>
            <td width="2%"><input type="checkbox" /></td>
            <td width="15%">送货上门（需要窝点）</td>
            <td width="2%"><input type="checkbox" /></td>
            <td width="54%">预定位置（需要窝点）</td>
          </tr>
        </table>
        <table width="100%" bgcolor="#fbf6e3" border="0" cellspacing="0" cellpadding="0">
          <tr height="40">
            <td width="16%" align="right">是否促销：</td>
            <td width="13%">
            <select id="isDiscountId" name="isDiscount" class="extension_select" style="width:105px;" onchange="discountFun()">
              <option value="1" selected="selected">是</option>
              <option value="0">否</option> 
            </select></td>
            <td width="4%">&nbsp;</td>
            <td width="5%">&nbsp;</td>
            <td width="10%">&nbsp;</td>
            <td width="52%">&nbsp;</td>
          </tr>
          <tr height="40">
            <td align="right">原价：</td>
            <td><input id="sellPriceId" name="sellPrice" class="extension_input"  style="width:100px;"/></td>
            <td>元</td>
            <td><span id="discountLableId">现价：</span></td>
            <td><input id="discountPriceId" name="discountPrice" class="extension_input"  style="width:80px;"/></td>
            <td><span id="discountUnitId">元</td>
          </tr>
        </table>
        <table width="100%" style="margin-top:8px;" bgcolor="#fbf6e3" border="0" cellspacing="0" cellpadding="0">
          <tr height="40">
            <td width="16%" align="right">推广此产品：</td>
            <td width="13%">
            <select id="isExtensionId" name="select" class="extension_select" style="width:105px;" onchange="extensionFun()">
              <option value="1">是</option>
              <option value="0">否</option> 
            </select></td>
            <td><font style="margin-left:5px; color:#999;">推广以后您的产品会放在所在区域，最醒目位置。</font></td>
          </tr>
          <tr height="40" id="extensionTrId">
            <td align="right">选择时间段：</td>
            <td><select name="select2" class="extension_select" style="width:105px;">
              <option>1个月</option>
              <option>2个月</option>
              <option>3个月</option>
              <option>4个月</option>
              <option>5个月</option>
              <option>6个月</option>
              <option>7个月</option>
              <option>8个月</option>
              <option>9个月</option>
              <option>10个月</option>
              <option>12个月</option>
            </select></td>
            <td>需支付窝点：<font style="font-weight:700; color:#F30; font-size:16px; margin-left:5px; margin-right:5px;">999</font>点<input style="margin-left:8px;" type="button"  class="commentReplyBut" value="支付"/></td>
          </tr>
        </table>
        <table width="100%"  style="margin-top:15px;" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="16%"  valign="top" align="right">描述：</td>
            <td><textarea id="productBriefId" name="productBrief" class="extension_input" style="width:500px; height:70px;" ></textarea></td>
            <td>&nbsp;</td>
          </tr>
          <tr height="130">
            <td>&nbsp;</td>
            <td width="69%" align="center">
            	<input  type="button" onclick="submitFun()" class="productAddBut" value="发 布"/></td>
            <td width="15%">&nbsp;</td>
          </tr>
        </table>

      </div>
    </div>
    </form>
  </div>